<template>
  <div>
    <h2>List</h2>
    <button @click="setUserInfo">将数据传给App</button>
  </div>
</template>

<script>
export default {
  name: "List",
  data() {
    return {
      userInfo: [
        { id: "001", name: "小明", sex: "男" },
        { id: "002", name: "小昭", sex: "男" },
        { id: "003", name: "小天", sex: "男" },
      ],
    };
  },
  methods:{
    setUserInfo(){
      this.$emit("getUserInfo",this.userInfo)
    }
  }
};
</script>

<style>
</style>